<template>
  <div>
    <h2>我是第一个组件</h2>
    <h1>组件渲染person.name{{person.name}}</h1>
    <h1>组件渲染person.age{{person.age}}</h1>
    <h1>组件渲染person.salary{{person.salary}}</h1>
    <slot name="asd"></slot>
    <slot name="qwe"></slot>
    <button @click="handlechange">改</button>
  </div>
</template>

<script>

export default {
  setup (props,context) {
    function handlechange(){
      console.log(props.person.name)
      console.log(context.slots)
      context.emit('change','李四')
    }
    return {
      handlechange
    }
  },
  props:['person'],
  emits:['change']
}
</script>

<style lang="less" scoped>

</style>